<include file="./Public/Home/header.html" />
<div class="curriculum_details">
    <div class="curriculum_details_box">
        <h3>{$courseInfo.name}</h3>
        <p>发表时间{$courseInfo.createtime}</p>
        <div class="curriculum_details_content">
            {$courseInfo.value}
        </div>
    </div>
    <div class="details_btn">
        <a href="javascript:history.go(-1)">返回</a>
        <a href="javascript:void(0)" onclick="Submit()">购买</a>
    </div>
</div>
<script>
    //快速提交
    function Submit() {
         var course_id = "{$courseInfo.id}";
        $.ajax({
            url: "{:U('Index/Order')}",
            type: 'post',
            data: {
                'courses_id':course_id
            },
            dataType: "json",
            success: function (json) {
                if (json.status == 1) {
                    window.location.href="{:U('Home/Index/wx_pay')}"+'?orderId='+json.orderId;
                }else if(json.status == 2){
                    alert_fun(json.error);
                    window.location.href="{:U('Home/Index/home')}";
                } else {
                    alert_fun(json.error);
                }
            }
        })
    }

</script>
<include file="./Public/Home/footer.html" />